package com.gitee.wsl.common.ui.ext.shape.polygon

/*
import androidx.graphics.shapes.RoundedPolygon
import androidx.graphics.shapes.toPath
import com.gitee.wsl.common.ui.ext.getBounds
import com.gitee.wsl.compose.base.Shapes

class RoundedPolygonShape(
    private val polygon: RoundedPolygon,
    private var matrix: Matrix = Matrix()
) : Shape {
    private var path = Path()
    override fun createOutline(
        size: Size,
        layoutDirection: LayoutDirection,
        density: Density
    ): Outline {
        path.rewind()
        path = polygon.toPath().asComposePath()
        matrix.reset()
        val bounds = polygon.getBounds()
        val maxDimension = max(bounds.width, bounds.height)
        matrix.scale(size.width / maxDimension, size.height / maxDimension)
        matrix.translate(-bounds.left, -bounds.top)

        path.transform(matrix)
        return Outline.Generic(path)
    }
}

fun Shapes.roundedPolygon(
   polygon: RoundedPolygon,
   matrix: Matrix = Matrix()
) = RoundedPolygonShape(polygon,matrix)*/
